﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Models
{
    [Serializable()]
    public class Idea : ISerializable
    {
        public Int32 elementNum { get; set; }
        public Int32 category { get; set; }
        public String elementLbl { get; set; }
        public String statement { get; set; }
        public String clarification { get; set; }

        public Idea()
        {
            this.elementNum = 0;
            this.category = 0;
            this.elementLbl = "0";
            this.statement = "";
            this.clarification = "";
        }


        public Idea(Int32 elementNum, Int32 category, String elementLbl, String statement, String clarification)
        {
            this.elementNum = elementNum;
            this.category = category;
            this.elementLbl = elementLbl;
            this.statement = statement;
            this.clarification = clarification;
        }

        #region Serialization

        //Serialization function.
        public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
        {
            info.AddValue("elementNum", this.elementNum);
            info.AddValue("category", this.category);
            info.AddValue("elementLbl", this.elementLbl);
            info.AddValue("statement", this.statement);
            info.AddValue("clarification", this.statement);

        }

        //Deserialization constructor.
        public Idea(SerializationInfo info, StreamingContext ctxt)
        {
            this.elementNum = (int)info.GetValue("elementNum", typeof(int));
            this.category = (int)info.GetValue("category", typeof(int));
            this.elementLbl = (String)info.GetValue("elementLbl", typeof(String));
            this.statement = (String)info.GetValue("statement", typeof(String));
            this.clarification = (String)info.GetValue("clarification", typeof(String));
        }

        #endregion

    }
}
